<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:f="http://xmlns.jcp.org/jsf/core">
      <h:head>
    <title>Gift List</title>
</h:head>
<h:body onload="#{GiftManaged.allPackage()}">
	<h:form>
    <p:menubar>  
    <p:menuitem value="Home" url="home.xhtml" />  
        <p:submenu label="Package Section" >  
            <p:menuitem value="All Packages" url="package.xhtml" />  
        </p:submenu>  
  
        <p:submenu label="Gift List" >  
            <p:menuitem value="My Gift List" url="giftList.xhtml" />    
        </p:submenu>  
  
       <f:facet name="options">   
       		<p:commandButton value="Edit Profile" action="profileEdit.xhtml"/>
            <p:commandButton value="Logout" action="#{LoginManaged.logout()}" icon="ui-icon-close" />
       </f:facet>
    </p:menubar>  
    </h:form>

	<h:form>
	
	<p:dataTable id="dataTable" var="p" value="#{GiftManaged.glDTO}" widgetVar="packageTable" emptyMessage="No package found with given criteria" filteredValue="#{GiftManaged.filteredPackage}" >
	<f:facet name="header">  
            <p:outputPanel>  
                <h:outputText value="Search all fields:" />  
                <p:inputText id="globalFilter" onkeyup="packageTable.filter()" style="width:150px" />  
            </p:outputPanel>  
    </f:facet>  
		<p:column id="nameColumn" filterBy="name" headerText="Name" filterMatchMode="contains" >    
            <h:outputText value="#{p.name}" />  
        </p:column>	
        <p:column id="nationColumn" filterBy="nation" headerText="Nation" filterMatchMode="contains" >    
            <h:outputText value="#{p.nation}" />  
        </p:column>	
        <p:column id="priceHotelColumn" filterBy="priceHotel" headerText="Hotel Price" filterMatchMode="contains" >    
            <h:outputText value="#{p.priceHotel}" />  
        </p:column>	
        <p:column>    
            <p:commandButton value="View" action="#{GiftManaged.changePage(p.id)}" ajax="false" />
        </p:column>	
	</p:dataTable>
	<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
	
    </h:form>
</h:body>
</html>